Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit d2c26a306e802e632422398f0ba022cc0a236c53


Parents : ed096cf
Author : Mark Qvist <mark@unsigned.io>
Date : 2022-10-12T16:33:05+02:00

Tuned UI behaviour

Changes

2 files changed, 11 insertions(+), 4 deletions(-)

M sbapp/main.py +10 -4

Diff

diff --git a/sbapp/main.py b/sbapp/main.py
index 44ca7e28..6dffa498 100644
--- a/sbapp/main.py
+++ b/sbapp/main.py
@@ -122,7 +122,7 @@ class SidebandApp(MDApp):
self.loading_updater.cancel()
def start_core(self, dt):
- self.loading_updater = Clock.schedule_interval(self.update_init_status, 0.3)
+ self.loading_updater = Clock.schedule_interval(self.update_init_status, 0.1)
self.check_permissions()
self.start_service()
@@ -242,7 +242,8 @@ class SidebandApp(MDApp):
self.sideband.should_persist_data()
if self.conversations_view != None:
self.root.ids.conversations_scrollview.effect_cls = ScrollEffect
- self.conversations_view.update()
+ # TODO: Check if we actually need this
+ self.sideband.setstate("wants.viewupdate.conversations", True)
self.root.ids.conversations_scrollview.scroll = 1
RNS.log("App paused", RNS.LOG_DEBUG)
@@ -256,7 +257,8 @@ class SidebandApp(MDApp):
self.app_state = SidebandApp.ACTIVE
if self.conversations_view != None:
self.root.ids.conversations_scrollview.effect_cls = ScrollEffect
- self.conversations_view.update()
+ # TODO: Check if we actually need this
+ # self.sideband.setstate("wants.viewupdate.conversations", True)
self.root.ids.conversations_scrollview.scroll = 1
else:
@@ -351,6 +353,10 @@ class SidebandApp(MDApp):
if self.conversations_view != None:
self.conversations_view.update()
+ if self.sideband.getstate("wants.viewupdate.conversations"):
+ if self.conversations_view != None:
+ self.conversations_view.update()
+
def on_start(self):
self.last_exit_event = time.time()
self.root.ids.screen_manager.transition.duration = 0.25
@@ -464,7 +470,7 @@ class SidebandApp(MDApp):
MDApp.get_running_app().stop()
Window.close()
- Clock.schedule_once(final_exit, 0.5)
+ Clock.schedule_once(final_exit, 0.65)
def announce_now_action(self, sender=None):
self.sideband.lxmf_announce()

diff --git a/sbapp/ui/conversations.py b/sbapp/ui/conversations.py
index 56e74a6a..27bf00bf 100644
--- a/sbapp/ui/conversations.py
+++ b/sbapp/ui/conversations.py
@@ -58,6 +58,7 @@ class Conversations():
self.app.sideband.setstate("app.flags.unread_conversations", False)
self.app.sideband.setstate("app.flags.new_conversations", False)
+ self.app.sideband.setstate("wants.viewupdate.conversations", False)
def update_widget(self):
us = time.time()


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────